package com.effectivsocial.controller;

import java.util.List;

import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.effectivsocial.domain.SocialNetwork;
import com.effectivsocial.service.api.SocialNetworkService;


@Controller
@Slf4j
@RequestMapping("/network")
public class ListNetworkController {
	
	@Inject
	private SocialNetworkService socialNetworkService;
			
	@RequestMapping(value="/viewnetworks")
	public String listApplications(Model model, Pageable pageable){
		
		
		List<SocialNetwork> networks = socialNetworkService.findByLoggedInUser(pageable);
		model.addAttribute(networks);
		
		return "viewnetworks";
	}
	
	
	
}
